package org.xinjiang.data.migration.flush.enums;

import lombok.Getter;

/**
 * 职称
 */
@Getter
public enum TitleEnum {
    初级("1", "初级", "1", null),
    中级("2", "中级", "2", null),
    高级("3", "高级", "3", null),
    UNKNOWN("4", "其他", "4", null);

    /* 数据来源code
     */
    private String sourceCode;

    /**
     * 数据来源名成
     */
    private String sourceName;


    private String targetCode;

    private Integer id;

    TitleEnum(String sourceCode, String sourceName, String targetCode, Integer id) {
        this.sourceCode = sourceCode;
        this.sourceName = sourceName;
        this.targetCode = targetCode;
        this.id = id;
    }

    public static TitleEnum toCode(String sourceCode) {
        for (TitleEnum value : TitleEnum.values()) {
            if (value.sourceCode.equals(sourceCode)) {
                return value;
            }
        }
        return UNKNOWN;
    }
}
